import adminView from '@/admin.ejs';

export default function(router){
    router.route("/admin",(req,res,next)=>{
        next(
            adminView({subRoute:res.subRoute(),url:req.url})
        )

        let list = document.querySelectorAll(".menu-left li");
        list.forEach((item,key)=>{
            item.onclick = function (){
                if(key==0){
                    router.go("/admin/users")
                    // item.style.color = "red";
                }else if(key==1){
                    router.go("/admin/adv")
                }
            }
        })
    })
}